/*
 * Copyright (C) 2015 - present Instructure, Inc.
 *
 * This file is part of Canvas.
 *
 * Canvas is free software: you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License as published by the Free
 * Software Foundation, version 3 of the License.
 *
 * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License along
 * with this program. If not, see <http://www.gnu.org/licenses/>.
 */

.react-select-box-container {
  position: relative;
  width: 240px;
  display: inline-block;
  background-color: $ic-color-light;
  border-radius: $borderRadius;
  border: 1px solid $ic-border-color;
  text-align: left;
  box-shadow: 0 0 2px rgba(0, 0, 0, .3);
}
.react-select-box {
  padding: $ic-sp 0;
  display: inline-block;
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
  background-color: transparent;
}

.react-select-box:before {
  content: ' ';
  z-index: 1;
  position: absolute;
  height: 20px;
  top: 15px;
  right: 34px;
  border-left: 1px solid $ic-border-color;
}

.react-select-box:after {
  content: ' ';
  position: absolute;
  z-index: 1;
  top: 20px;
  right: 13px;
  border-top: 6px solid $ic-color-dark;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}

.react-select-box-label,
.react-select-box-option {
  line-height: $ic-line-height;
  @include fontSize($ic-font-size--xsmall);
  font-weight: bold;
  color: $ic-font-color-dark;
}

.react-select-box-label {
  padding: 0 $ic-sp*4 0 $ic-sp;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: $ic-font-color-dark;
}

.react-select-box-empty .react-select-box-label {
  color: $ic-font-color-dark;
}

.react-select-box-click-outside-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
}

.react-select-box-clear {
  position: absolute;
  top: 15px;
  right: 0;
  width: 35px;
  height: 20px;
  background-color: $ic-color-light;
  text-indent: -9999em;
  z-index: 3;
  border: none;
}

.react-select-box-clear:before {
  content: '×';
  position: absolute;
  top: 2px;
  left: 10px;
  z-index: 1;
  background-color: $ic-color-medium;
  border-radius: 100%;
  @include fontSize(13px);
  color: $ic-font-color-light;
  line-height: 1;
  width: 15px;
  height: 15px;
  text-indent: 0;
  text-align: center;
}

.react-select-box-clear:hover:before,
.react-select-box-clear:focus:before {
  background-color: $ic-brand-primary;
}

.react-select-box-hidden {
  display: none;
}

.react-select-box-options {
  margin: 2px 0 0;
  position: absolute;
  padding: 10px 0;
  width: 240px;
  top: 100%;
  left: 0;
  z-index: 4;
  background-color: $ic-color-light;
  border-radius: $borderRadius;
}

.react-select-box-options-list {
  list-style: none outside;
  margin: 0;
  padding: 0;
}

.react-select-box-option {
  padding: $ic-sp;
  margin: 0;
  cursor: pointer;
  display: block;
  line-height: $ic-line-height;
  text-decoration: none;
}

.react-select-box-option:hover {
  color: $ic-font-color-light;
  background-color: $ic-brand-primary;
  text-decoration: none;
}

.react-select-box-option-selected {
  color: $ic-color-medium-light;
}

.react-select-box-multi .react-select-box-option {
  padding-left: 42px;
  position: relative;
}

.react-select-box-multi .react-select-box-option:before {
  content: ' ';
  position: absolute;
  line-height: 1;
  text-align: center;
  left: 20px;
  top: 9px;
  border-radius: 3px;
  height: 12px;
  width: 12px;
  margin-right: 10px;
  border: 1px solid $ic-border-color;
  background: $ic-color-medium-light;
  vertical-align: middle;
}

.react-select-box-multi .react-select-box-option-selected:before {
  content: '✓';
}


.react-select-box-multi .react-select-box-option-selected {
  color: $ic-font-color-dark;
}

.react-select-box-option:focus,
.react-select-box-option-focused {
  color: $ic-font-color-light;
  outline: 0;
  background-color: $ic-brand-primary;
}

.react-select-box-close {
  color: $ic-brand-primary;
  text-transform: uppercase;
  background-color: transparent;
  border: none;
  padding: 5px 0;
  display: block;
  text-align: center;
  width: 100%;
  font-weight: bold;
  cursor: pointer;
  outline: none;
}

.react-select-box-close:hover,
.react-select-box-close:focus {
  text-decoration: underline;
}

.react-select-box-empty .react-select-box-close {
  color: $ic-font-color-dark;
}

.react-select-box-native {
  position: absolute;
  left: -99999em;
}
